<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="root">
    <p>a.b:{{a.b}}</p>
    <p>a.c:{{a.c}}</p>
    <button @click="update">更新</button>
  </div>
  <script src="../js/vue.js"></script>
  <script>
     new Vue({
       el:"#root",
       data:{
         a:{b :123,}
       },
       methods:{
          update(){
            if(!this.a.hasOwnProperty('c')){
              Vue.set(this.a,'c','abc')
            }else{
             // Vue.set(this.a,'c','abc--')
             this.a.c =this.a.c+'--'
            }
          }
       }
     })
  </script>
</body>
</html>